package com.longcai.mapper.goods;

import com.longcai.entity.homegood.ClyjGoodsHomepage;
import com.longcai.entity.homegood.ClyjGoodsSpec;
import com.longcai.entity.homepage.ClyjGoodsType;
import com.longcai.entity.homepage.GoodsClass;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

/**
 * <p>
 * 首页商品表 Mapper 接口
 * </p>
 *
 * @author LWK
 * @since 2019-03-22
 */
@Mapper
@Repository
public interface ClyjGoodsHomepageMapper extends BaseMapper<ClyjGoodsHomepage> {
	
	@Select("select c.* from goods_class c , clyj_goods_type cb where c.id = cb.type_id and cb.goods_id = #{goodsId} order by c.type_sort")
	List<GoodsClass> listByBrandId(String goodsId);

	void deleteType(String goodsId);

	void insertType(Map map);

	void insertSpec(Map map);

	void deleteSpec(String goodsId);

	@Select("select * from clyj_goods_spec where goods_id = #{goodsId} order by spec_sort")
	List<ClyjGoodsSpec> getSpecByGoodsId(String goodsId);

	void deletePics(String goodsId);
	@Select("select * from clyj_goods_type where type_id =  #{string}")
	List<ClyjGoodsType> selectGoodsByType(String string);

}
